package com.chaofan.websocket.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chaofan.websocket.entity.LuckyCommand;
import com.chaofan.websocket.entity.MsgRecord;
import com.chaofan.websocket.entity.MsgRecordPoJO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface MsgRecordMapper extends BaseMapper<MsgRecord> {
    @Select("SELECT id,room_id,user_id,wexin_name,wexin_id,(select image from admin_weixin_user as a where a.wexin_id=wexin_id) as image,type,msg,update_time,create_time FROM admin_user_msg_record WHERE room_id = #{map.roomId} ORDER BY id")
    IPage<MsgRecordPoJO> selectAllMsg(IPage<MsgRecordPoJO> page, @Param("map") Map map);
}
